The present invention relates to a method and apparatus for measuring a waveform and, more particularly, to an electricity metering method and apparatus using a data processor interrupt to initiate sampling of voltage and current waveforms.
Electric power is typically generated at a remote, central generating facility and transported to the consumer over a distribution system. To reduce power transportation losses, a step-up, subtransmission transformer is used to increase the voltage and reduce the current for transmission over a transmission line. The actual transmission line voltage usually depends on the distance between the subtransmission transformers and the consumers of the electricity but is commonly in the range of 2–35 kilo-volts (“kV”). Distribution substation transformers and distribution transformers of an electric utility's secondary power distribution system reduce the voltage from the transmission line level to a distribution voltage for delivery and use by industrial, commercial, and residential consumers. In the United States, for example, electric power is typically delivered to the consumer as an alternating current (AC) voltage ranging from 120 volts (“V”) to 660 V, depending upon the use. As generated, the fundamental AC voltage and current approximate “in-phase,” 60 Hertz (“Hz”) sine waves over time.
The consumption of power by individual consumers and the performance of the distribution system are monitored by power meters. Power meters are used to monitor a number of electrical parameters related to power distribution and use, including the active power, the time rate of transferring or transforming energy, and the apparent power, the product of the root mean square (RMS) voltage and current. In addition, the reactive power, the product of the RMS voltage and the quadrature component of the current, and the power factor or quality factor, the ratio of active power to apparent power, are commonly monitored. The usefulness of monitoring a variety of electric power parameters has favored adoption of digital power meters that incorporate digital data processing systems. In a digital power meter, the voltage and current waveforms are captured as digital data and the data processing system calculates the various electric power parameters from the digital waveform data using appropriate mathematical formulas that are typically stored in the meter.
Referring to FIG. 1, the effective power of the analog sinusoidal voltage 20 and current 22 waveforms is the integral of the product of the instantaneous magnitudes of the voltage and current averaged over a time period, usually a cycle of the waveform:
                    P        =                              1            T                    ⁢                                    ∫              0              T                        ⁢                          (                                                v                  ⁡                                      (                    t                    )                                                  ⁢                                  i                  ⁡                                      (                    t                    )                                                  ⁢                                                                  ⁢                                  ⅆ                  t                                                                                        (        1        )            where:                v(t)=instantaneous voltage at time t        i(t)=instantaneous current at time t        T=time period, typically a waveform cycle periodIn a digital power meter, the sinusoidal analog voltage 20 and current 22 waveforms are digitally captured by periodically sampling the amplitude of the outputs of voltage and current transducers which produce signals representative of the voltage and current, respectively, in a transmission line conducting power to a load. The effective power is typically approximated by averaging the sum of the products of the respective instantaneous voltage and current samples for each of the plurality of sampling intervals making up at least one cycle of the waveform:        
                    P        ≅                              1            T                    ⁢                                    ∑                              k                =                1                                            k                =                                  T                                      Δ                    ⁢                                                                                  ⁢                    t                                                                        ⁢                                          v                ⁡                                  (                  k                  )                                            ⁢                              i                ⁡                                  (                  k                  )                                            ⁢              Δ              ⁢                                                          ⁢              t                                                          (        2        )            where:                v(k)=sample voltage for the k-th sample, for example voltage 24        i(k)=sample current for the k-th sample, for example current 26        Δt=sampling interval        
Accurate measurement of the various electrical parameters, including effective power, with a digital power meter requires accurate control of the sampling interval. Typically, digital electric power meters include a sampling unit for each phase of the single phase or 3-phase current carried by the transmission line. The sampling unit controls and performs the sampling and digitizing of the voltage and current waveforms. A sampling unit typically comprises a voltage transducer, a current transducer, an analog-to-digital converter (ADC) to convert the instantaneous amplitudes of the voltage or current samples to discrete digital signals of finite precision; one or more digital signal processors (DSP) to read and store the digital values of the voltage and current samples and a sampling clock to provide a precise sampling interval to the ADC and DSP. Typically, a DSP dedicated to the task of reading and storing the sample values of the voltage and current polls the ADC or responds to an interrupt initiated by the sampling clock to read the ADC.
The processing power of microprocessors has significantly increased and microprocessors are available with sufficient processing power to perform the sampling of the voltage and current waveforms as well as the other tasks related to the operation of a power meter. Microprocessors are often used to perform a plurality of tasks that may occur coincidently and commonly use interrupts to determine the order of performance of the various tasks. A microprocessor responds to an interrupt request signal, usually from external hardware, by suspending processing of a lower priority task; storing addresses for the interrupted program instructions and any intermediate results of the suspended task; and initiating processing of the interrupt service routine, the program instructions for the higher priority interrupting task. Upon completion of the interrupting task, the microprocessor returns to the interrupted task and, unless a higher priority, second interrupt has been received, continues processing the interrupted task. While microprocessors are commonly used to perform multiple tasks, interrupt latency makes combining the real time tasks, such as those performed by the sampling unit of a power meter, with the other data processing tasks related to meter operation problematic. Interrupt latency refers to the time interval between the assertion of an interrupt and the initiation of the interrupt service routine for the asserted interrupt. Interrupt latency makes the timing of the initiation of the execution of the interrupt uncertain, making the timing of real-time tasks, such as sampling unreliable, and, as a result, potentially making the output of the meter inaccurate. If a data processing device could perform sampling as well as other power meter tasks, a digital signal processor dedicated to the sampling task would be unnecessary and the cost of digital power meters could be significantly reduced.
What is desired, therefore, is a method and apparatus for periodically sampling an electrical waveform with a data processor that performs tasks other than waveform sampling.